<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Apply</title>
</head>
<body>
	Apply实现
</body>
<script>
    Function.prototype.myApply = function(context) {
        context = context ? Object(context) : window;
        context.fn = this
        const r = context.fn([...arguments][1])
        delete context.fn
        return r
    }
	function test() {
		console.log('this', this)
        console.log('arguments', arguments)
	}
	var obj = {name:12}
	test.myApply(obj, [1, 2 ,3])
</script>
</html>